<#ftl strip_whitespace=true>
<#assign StringUtils = beansWrapperFn.getStaticModels()["org.apache.commons.lang3.StringUtils"]>
<#assign SiteUtils = beansWrapperFn.getStaticModels()["com.cardone.platform.configuration.util.SiteUtils"]>
<#assign DictionaryUtils = beansWrapperFn.getStaticModels()["com.cardone.platform.configuration.util.DictionaryUtils"]>
<#assign NavigationUtils = beansWrapperFn.getStaticModels()["com.cardone.platform.authority.util.NavigationUtils"]>
<#assign UserUtils = beansWrapperFn.getStaticModels()["com.cardone.platform.usercenter.util.UserUtils"]>
<#assign DateUtils = beansWrapperFn.getStaticModels()["com.cardone.common.util.DateUtils"]>

<#assign webContextUrl = cardone.StringUtils.defaultIfBlank(contextSite.contextPath,"")>
<#assign webViewsRoot = cardone.StringUtils.defaultIfBlank(contextSite.contextPath,"") + '/views'>
<#assign webWidgetRoot = cardone.StringUtils.defaultIfBlank(contextSite.contextPath,"") + '/widget'>
<#assign webSiteName = cardone.StringUtils.defaultIfBlank(contextSite.name,"")>
<#assign fileVersion = "1.2.201408141341">

<#macro defaultIfBlank str="" defaultSt="">${StringUtils.defaultIfBlank(str, defaultSt)}</#macro>

<#macro pagination pagination>
	<#if (pagination.totalSize > pagination.size)>
	<li><span>记录数${pagination.totalSize}条，共${pagination.totalNo}页</span></li>

	<#if pagination.hasFirstNo> <#if pagination.firstNo !=
	pagination.previousNo>
	<li><a href="#no_${pagination.firstNo}">第一页</a></li> </#if>
	<li><a href="#no_${pagination.previousNo}">上一页</a></li> </#if>
	<#list pagination.nos as no> <#if pagination.no == no>
	<li class="active"><span>${no}</span></li> <#else>
	<li><a href="#no_${no}">${no}</a></li> </#if> </#list> <#if
	pagination.hasLastNo>
	<li><a href="#no_${pagination.nextNo}">下一页</a></li> <#if
	pagination.lastNo != pagination.nextNo>
	<li><a href="#no_${pagination.lastNo}">最后一页</a></li> </#if> </#if>
	</#if>
</#macro>

<#macro masterBlank cardonePagePath = ('/'+ (cardoneViewName!))>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>${(cardone.webSiteName)!}</title>
		
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="${(cardone.webSiteName)!}">
		<meta name="author" content="yaohaitao">
		
		<meta HTTP-EQUIV="X-UA-Compatible" CONTENT="IE=edge">
		<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
		<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
		<meta HTTP-EQUIV="expires" CONTENT="0">
		
		<link rel="stylesheet" href="${(cardone.webWidgetRoot)!}/bootstrap/css/bootstrap.min.css?_v=${(cardone.fileVersion)!}">
		<link rel="stylesheet" href="${(cardone.webWidgetRoot)!}/bootstrap/css/bootstrap-theme.min.css?_v=${(cardone.fileVersion)!}">
		
		<link rel="stylesheet" href="${(cardone.webViewsRoot)!}/${contextSite.styleCode}/main.css?_v=${(cardone.fileVersion)!}">
		<link rel="stylesheet" href="${(cardone.webViewsRoot)!}${cardonePagePath!('/'+ (cardoneViewName!))}.css?_v=${(cardone.fileVersion)!}">
	</head>
	<body>
		<#nested>
		
		<script type="text/javascript" src="${(cardone.webWidgetRoot)!}/seajs/sea.js?_v=${(cardone.fileVersion)!}" id="seajsnode"></script>
		
		<script type="text/javascript">
			var cardone = {
				webContextUrl : '${(cardone.webContextUrl)!}',
				webViewsRoot : '${(cardone.webViewsRoot)!}',
				theme : 'bootstrap',
				locale : 'zh_CN'
			};
		
			seajs.config({
				alias : {
					'jquery' : '${(cardone.webWidgetRoot)!}/jquery-1.10.2.min.js',
					'jquery-ui' : '${(cardone.webWidgetRoot)!}/jquery-ui/jquery-ui-1.10.3.custom.min.js',
					'jquery-iframe-transport' : '${(cardone.webWidgetRoot)!}/jQuery-File-Upload-9.5.7/js/jquery.iframe-transport.js',
					'bootstrap' : '${(cardone.webWidgetRoot)!}/bootstrap/js/bootstrap.min.js',
					'bootstrap-typeahead' : '${(cardone.webWidgetRoot)!}/bootstrap/js/bootstrap2-typeahead.min.js',
					'jquery.validate' : '${(cardone.webWidgetRoot)!}/jquery-validation/dist/jquery.validate.min.js',
					'ckeditor' : '${(cardone.webWidgetRoot)!}/ckeditor/ckeditor.js',
					'ckeditor-jquery' : '${(cardone.webWidgetRoot)!}/ckeditor/adapters/jquery.js',
					'chosen' : '${(cardone.webWidgetRoot)!}/chosen.jquery.min.js',
					'fileupload-js' : '${(cardone.webWidgetRoot)!}/jQuery-File-Upload-9.5.7/js/jquery.fileupload.js',
					'fileupload-css' : '${(cardone.webWidgetRoot)!}/jQuery-File-Upload-9.5.7/css/jquery.fileupload.css',
					'c1' : '${(cardone.webWidgetRoot)!}/cardone/cardone.js'
				},
				debug : true,
				map: [[ /^(.*\.(?:css|js))(.*)$/i, '$1?_v=${(cardone.fileVersion)!}' ]],
				charset : 'utf-8'
			});
		
			seajs.use([ 'jquery', '${(cardone.webViewsRoot)!}${cardonePagePath!}'], function(jq, page) {
				$.ajaxSetup({
					cache : false,
					dataType:"json" 
				});
		
				cardone.page = page;
		
				if ($.isFunction(page.init)) {
					page.init();
				}
			});
		</script>
	</body>
</html>
</#macro>

<#macro masterStandar cardonePagePath = ('/'+ (cardoneViewName!))>
<@masterBlank cardonePagePath=cardonePagePath>
		<nav class="navbar navbar-default c1-navbar-top" role="navigation">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					<span class="sr-only">切换导航</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">${cardone.webSiteName!}</a>
			</div>
		
			<div class="navbar-text navbar-right">
				<div class="btn-group">
					<button type="button" class="btn btn-primary">admin</button>
					<button type="button" class="btn btn-default">注销</button>
				</div>
			</div>
		</nav>
	
		<div class="container c1-container-1">
			<div class="row">
				<div class="col-md-2">
					<#assign navigationList=cardone.NavigationUtils.findListBySiteCodeAndParentIdForTree(contextSite.code, null, 2)> 
					<#if (navigationList)??>
					<div class="panel-group c1-full-1" id="c1-accordion-left">
					<#list navigationList as navigation>
						<#if navigation.childs??>
					  <div class="panel panel-default">
					    <div class="panel-heading">
					      <h4 class="panel-title">
					        <a class="btn-block" data-toggle="collapse" data-toggle="collapse" data-parent="#c1-accordion-left" href="#c1-${navigation.id!}">
					         ${navigation.name!}
					        </a>
					      </h4>
					    </div>
					    
					    <div id="c1-${navigation.id!}" class="panel-collapse collapse<#if navigation.active> in</#if>">
					      <div class="panel-body">
							<#if navigation.childs??>
							<ul class="nav nav-pills nav-stacked">
								<#list navigation.childs as childNavigation>
								<#if childNavigation.active>
									<li class="active"><a href="${childNavigation.href!}">${childNavigation.name!}</a></li>
								<#else>
									<li><a href="${childNavigation.href!}">${childNavigation.name!}</a></li>
								</#if>
							     </#list>
							</ul>
							</#if>
					      </div>
					    </div>
					  </div>
						<#else>
					  <div class="panel panel-default">
					    <div class="panel-heading">
					      <h4 class="panel-title">
					        <a class="btn-block" href="${navigation.href!}">${navigation.name!}</a>
					      </h4>
					    </div>
					  </div>
						</#if>
						
					</#list>
					</div>
					</#if>
				</div>
				<div class="col-md-10">
					<ol class="breadcrumb c1-full-2">
						<li><a href="${(cardone.webContextUrl)!}/index.html">主页</a></li>
						<#assign breadcrumbList=cardone.NavigationUtils.findListForBreadcrumb(navigationList)> 
						<#if breadcrumbList??>
						<#list breadcrumbList as breadcrumb>
							<#if !cardone.StringUtils.equals(breadcrumb.href, ((cardone.webContextUrl!) + '/index.html'))>
								<#if breadcrumb_has_next>
								<li><a href="${breadcrumb.href!}">${breadcrumb.name!}</a></li>
								<#else>
								<li class="active">${breadcrumb.name!}</li>
								</#if>
							</#if>
						</#list>
						</#if>
					</ol>
				
					<#nested>
				</div>
			</div>
		</div>
			
		<div class="modal fade c1-modal">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4 class="modal-title"></h4>
					</div>
					<div class="modal-body"></div>
				</div>
			</div>
		</div>
		
		<div class="modal fade c1-modal-confirm">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4 class="modal-title">确认</h4>
					</div>
					<div class="modal-body"></div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary c1-btn-confirm" data-dismiss="modal">确定</button>
						<button type="button" class="btn btn-default c1-btn-cancel" data-dismiss="modal">取消</button>
					</div>
				</div>
			</div>
		</div>
		
		<div class="modal fade c1-modal-alert">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4 class="modal-title">提示</h4>
					</div>
					<div class="modal-body"></div>
					<div class="modal-footer">
						<button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
					</div>
				</div>
			</div>
		</div>
		
		<div class="modal fade c1-modal-progress">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-body">
						<div class="progress">
							<div class="progress-bar progress-bar-success" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
</@masterBlank>
</#macro>



